Building new plugin
Hello,
I just subscribed to this list because I wrote a new plugin and my building process is somewhat messy.
I work on debian and started from the debian trixie source repository.
My plugin consists of a single C file and works well with a VM.
The purpose of the plugin is to reduce TPM PCR clutter when simple parameters are used for booting.
The need for this came up during a recent project, where a counter (maintained as grubenv variable) was used to retry booting up to n times.
Since the variable value is expanded before the command line, for each try a different string is registered into the TPM.
Hence, for each boot option and trial a different overall hash results.
The concept of the maskverify plugin is to add a new command
maskverify
with one parameter, a regular expression.
This pattern is applied to the next line and the matching part is replaced by space characters before registering into the TPM.
Technically, a new verifier is defined. Upon first use, it searches the verifier list, and if it finds the TPM verifier,
it removes the TPM verifier, and registers itself.
Whenever a verification function is called, either the original verifier is invoked, or, if there is a stored pattern,
the pattern is masked and the masked string is handed to the original verifier.
Upon termination, the original verifier is restored.
Note that the mask command is of course included in the measurements.
So there is no security gap because an added maskverify command elsewhere will be recorded and change the signature.
I tried to place my source code into a subdirectory of grub-core and include it in
|grub-core/Makefile.core.def|
|as described in|
https://giddi.net/posts/writing-custom-grub2-modules/
but that did not work somehow.
I ended up using a separate subdirectory, extracting all the options and pathes from a compile run and collecting this into
a script.
I created a second script for the mkimage so that my module and the tpm module is included.
Therefore my question, how should I create a github repositorty to publish this project, in particular what is to be included for building.
I will add some scripts/instructions for testing, but probably not a file for /etc/grub.
Thanks for you help.
Andreas
www.topas-research.ch
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel